{% extends "base.html" %}
{% load i18n %}
{% load promgen %}

{% block content %}

<div class="page-header">
  <h1>Datasource</h1>
</div>

{% breadcrumb label="Datasource" %}

<div class="service-grid">
  {% for shard in shard_list|dictsortreversed:"num_projects" %}
  <div>
    <h2><a href="{% url 'datasource-detail' shard.id %}" v-pre>{{ shard.name }}</a></h2>
    <a href="{{shard.url}}" v-pre>{{shard.url}}</a>
    <hr>

    {% include 'promgen/shard_header.html' %}
    {% regroup shard.project_set.all|dictsort:"service_id" by service as service_list %}

    <table class="table table-condensed">
      {% for service, project_list in service_list|dictsort:"grouper.name" %}
      <tr>
        <td>
          <a href="{{service.get_absolute_url}}" v-pre>{{ service.name }}</a>
        </td>
      </tr>
      {% endfor %}
    </table>
  </div>
  {% endfor %}
</div>
{% endblock %}
